function checkUser(callBack){
		$.ajax({
			 type: "post",
			  url:__ctxPath+"/front/common/checkLogin.do?cmd=checkUser",
			  cache: false,
			  success: function(msg){
				if(msg=="true"){
					callBack.call();
				}
				else{
					openLogin(callBack);
				}
			  }})
	}
	function openLogin(callBack){
		urlDialog=__ctxPath+"/common/openLogin.do?decorator=blank";
	createOverlayDlg("sendMsg",{
		title:'登录',
		width:820,
		height:500,
		bgiframe: true,
		buttons:{
			"登录":function (){		
		var j_username=$("#j_username").val();
		var j_password=$("#j_password").val();
			$.ajax({
				 type: "post",
				  url:__ctxPath+"/j_security_check",
				  data:{j_username:j_username,j_password:j_password},
				  cache: false,
				  async:false,
				  success: function(msg){
					if(msg.indexOf("用户或密码出错")!=-1){
						alert("登录失败");
					}else{
							$("#sendMsg").dialog("close");
							callBack.call();
					}
				  }
			  })
			},
			"取 消":function (){$(this).dialog("close");}
			},
			url:urlDialog
	});
	}
	
	function login(){
		var j_username=$("#j_username").val();
		var j_password=$("#j_password").val();
		if(j_username==''){
			alert('邮箱为空!');
			return false;
		}
		if(j_password==''){
			alert('密码为空!');
			return false;
		}
			$.ajax({
				 type: "post",
				  url:__ctxPath+"/j_security_check",
				  data:{j_username:j_username,j_password:j_password},
				  cache: false,
				  async:false,
				  success: function(msg){
					if(msg.indexOf("用户或密码出错")!=-1){
						alert("登录失败");
					}else{
							$("#sendMsg").dialog("close");
					}
				  }
			  })
	}
function checkFile(width,height,fileId){
	$.ajaxFileUpload(
			{
				url:__ctxPath+'/front/common/checkLogin.do?cmd=checkFile', 
				secureuri:false,
				fileElementId:fileId,
				dataType: 'text',
				 data: {
			             "width": width,   
				         "height": height  
				   },   
				success: function (msg)
				{
					if(msg.startWith("<pre>")){
						msg=msg.replace("<pre>","").replace("</pre>","");
					}
					if(msg=='true'){
						return true;
					}else{
						alert('您上传的图片不符合规范,请重新选择');
						$("#"+fileId).val('');
						return false;
					}
				}
			}
		);
}